#ifndef V4L2_H
#define V4L2_H
#include <iostream>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/videodev2.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <cstring>
#include <vector>

#define VIDEO_DEVICE "/dev/video0"
#define WIDTH 640
#define HEIGHT 480
#define NUM_BUFFERS 4
extern int fd;
struct Buffer {
    void* start;
    size_t length;
};
extern std::vector<v4l2_plane> planes;
extern std::vector<Buffer> global_buffers;

int v4l2_init(void);
#endif // V4L2_H
